package main

import (
	"errors"
	"time"
)

type FuncID int

const (
	GO_SEARCH = iota + 1
	GO_SEARCH_SORT
	CPLUS_SEARCH
	CPLUS_SORT
)

type Tester interface {
	//Create(service string, tp FuncID)
	Init()
	RunTest() bool
	Close()
}

func GetDoTester(service string, tp FuncID) (Tester, error) {
	switch service {
	case "lbs":

	case "searchRankC":
		//return NewSearchRankCPlusTester("searchRankC", tp), nil
	case "searchRankGo":
		//return NewSearchRankGOTester("searchRankGO", tp), nil
		//case "searchRankGOSort":
		//	return NewSearchRankGOReSortTester()
	}
	return nil, errors.New("暂不支持的请求类型，请指定正确的服务名:" + service)
}

type RPCStressTest struct {
	GoRoutineCount int
	ExecuteTime    time.Duration

	successVisitTotal int
	errorVisitTotal   int
	costTimeTotal     float64
}
